for (let key in ThumbnailState)
this._stateCounts[ThumbnailState[key]] = 0;
- // The "porthole" is the portion of the screen that we show in the workspaces
- this._porthole = Main.layoutManager.getWorkAreaForMonitor(Main.layoutManager.primaryIndex);
-
this.addThumbnails(0, global.screen.n_workspaces);
this._updateSwitcherVisibility();
for (let w = 0; w < this._thumbnails.length; w++)
this._thumbnails[w].destroy();
this._thumbnails = [];
+ this._porthole = null;
},
_workspacesChanged: function() {
},
addThumbnails: function(start, count) {
+ this._ensurePorthole();
for (let k = start; k < start + count; k++) {
let metaWorkspace = global.screen.get_workspace_by_index(k);
let thumbnail = new WorkspaceThumbnail(metaWorkspace);
// the size request to our children because we know how big they are and know
// that the actors aren't depending on the virtual functions being called.
- if (this._thumbnails.length == 0)
- return;
-
+ this._ensurePorthole();
let themeNode = this.actor.get_theme_node();
let spacing = themeNode.get_length('spacing');
},
_getPreferredWidth: function(actor, forHeight, alloc) {
- if (this._thumbnails.length == 0)
- return;
+ this._ensurePorthole();
let themeNode = this.actor.get_theme_node();
alloc.natural_size = width;
},
+ // The "porthole" is the portion of the screen that we show in the
+ // workspaces
+ _ensurePorthole: function() {
+ if (!this._porthole)
+ this._porthole = Main.layoutManager.getWorkAreaForMonitor(Main.layoutManager.primaryIndex);
+ },
+
_allocate: function(actor, box, flags) {
let rtl = (Clutter.get_default_text_direction () == Clutter.TextDirection.RTL);